﻿using System;

namespace CommandLinex
{
    [AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
    public class ArgumentAttribute : Attribute
    {
        /// <summary>
        /// 参数名称（--后面的部分）
        /// </summary>
        public string Name { get; }

        /// <summary>
        /// 参数说明
        /// </summary>
        public string Description { get; set; }

        /// <summary>
        /// 是否是必选参数
        /// </summary>
        public bool IsRequired { get; set; }

        /// <summary>
        /// 默认值
        /// </summary>
        public object DefaultValue { get; set; }

        /// <summary>
        /// 参数处理器类型（必须实现ICommandLineValueProcessor接口）
        /// </summary>
        public Type ProcessorType { get; set; }

        public ArgumentAttribute(string name)
        {
            Name = name ?? throw new ArgumentNullException(nameof(name));
        }
    }
}
